<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template_layout_lr.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<style>
.ui-button, .ui-button span, button.ui-button.ui-state-default span,
	.ui-button.ui-state-default span {
	font-weight: normal
}
</style>
	</ui:define>

	<ui:define name="left-box-title" style="border:0">
		保护分类
	</ui:define>
	<ui:define name="left-box-body">
		<h:form id="leftForm">
			<p:panel style="border:0;width:98%">
				<p:tree value="#{protectionSignalAlarmConfigController.root}" var="node" dynamic="true"
					id="tree" widgetVar="tree" animate="true" selectionMode="single" style="border:0">
					<p:ajax event="expand" update="tree"
						listener="#{protectionSignalAlarmConfigController.onNodeExpand}" />
					<p:ajax event="select"
						update=" rightForm:plist rightForm:addBtn :rightForm:editBtn :rightForm:delBtn"
						listener="#{protectionSignalAlarmConfigController.onNodeSelect}" />
					<p:treeNode type="manu" icon="fa fa-home">
						<h:outputText value="#{node}" />
					</p:treeNode>
					<p:treeNode type="model" icon="fa fa-user-secret">
						<h:outputText value="#{node}" />
					</p:treeNode>
				</p:tree>
			</p:panel>
		</h:form>
	</ui:define>
	<ui:define name="right-box-title">
		告警信号明细
	</ui:define>
	<ui:define name="right-box-body">
		<h:form id="rightForm">
			<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
				<p:commandButton value="是" type="button"
					styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
				<p:commandButton value="否" type="button"
					styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
			</p:confirmDialog>
			<div class="box box-solid with-border">
				<div class="box-header">
					告警内容搜索：<p:inputText value="#{protectionSignalAlarmConfigController.searchText}" />
					<p:commandButton icon="ui-icon-search" update="plist"
						actionListener="#{protectionSignalAlarmConfigController.search()}"
						style="margin-left:4px" value="搜索" />
				</div>
			</div>
			<p:toolbar id="toolbar">
				<f:facet name="left" >
					<p:commandButton value="新增" id="addBtn"
						disabled="#{protectionSignalAlarmConfigController.currentSelectNode==null }"
						oncomplete="PF('alarmManagerDialog').show()" update="crform:signalInfopg"
						actionListener="#{protectionSignalAlarmConfigController.preCreate()}" icon="ui-icon-document"
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bhgjxh_xz')}"></p:commandButton>
					<p:commandButton value="编辑" id="editBtn"
						disabled="#{protectionSignalAlarmConfigController.currentSelectSignal==null}"
						oncomplete="PF('alarmManagerDialog').show()" update="crform:signalInfopg"
						icon="ui-icon-pencil"
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bhgjxh_bj')}"></p:commandButton>
					<p:commandButton value="删除" id="delBtn"
						disabled="#{protectionSignalAlarmConfigController.currentSelectSignal==null}"
						update="plist editBtn @this :leftForm:tree"
						actionListener="#{protectionSignalAlarmConfigController.delete()}" icon="ui-icon-trash"
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bhgjxh_sc')}">
						<p:confirm header="提示" message="确定要删除么？" icon="ui-icon-alert" />
					</p:commandButton>
				</f:facet>
			</p:toolbar>
			<p:dataTable var="pebCurrent" id="plist" style="margin-top:5px"
				value="#{protectionSignalAlarmConfigController.signalList}" scrollHeight="570" scrollable="true"
				rowKey="#{pebCurrent.id}" widgetVar="plist" emptyMessage="无记录" rows="20"
				 paginator="true" rowIndexVar="ite" paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink}
				 {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
				<p:ajax event="rowSelectRadio" update="rightForm:editBtn rightForm:delBtn"
					listener="#{protectionSignalAlarmConfigController.onRowSelect}" />
				<f:facet name="{Customization}">
					<p:outputLabel value="总计：#{protectionSignalAlarmConfigController.signalList.size()} 条记录"
						style="margin-right:20px;"></p:outputLabel>
				</f:facet>
				<p:column selectionMode="single" style="text-align:center;width:50px" />
					<p:column headerText="序号 " style="width:10%;text-align:center">
						<h:outputText value="#{ite+1}" />
					</p:column>
				<p:column headerText="告警名称" style="width:20%">
					<h:outputText value="#{pebCurrent.alarmcname}" />
				</p:column>
				<p:column headerText="保护型号" style="width:10%">
					<h:outputText value="#{pebCurrent.protectedmodel}" />
				</p:column>
				<p:column headerText="主保护闭锁" style="width:10%">
					<h:outputText rendered="#{pebCurrent.firstlock==1}" value="是" />
				</p:column>
				<p:column headerText="后备保护闭锁" style="width:10%">
					<h:outputText rendered="#{pebCurrent.secondlock==1}" value="是" />
				</p:column>
				<p:column headerText="重合闸闭锁" style="width:10%">
					<h:outputText rendered="#{pebCurrent.thirdlock==1}" value="是" />
				</p:column>
				<p:column headerText="备注" style="width:50%">
					<h:outputText value="#{pebCurrent.remark}" />
				</p:column>
			</p:dataTable>
		</h:form>

		<p:dialog widgetVar="alarmManagerDialog" header="告警信号管理" closable="false" resizable="false"
			draggable="false" modal="true" width="400" height="400">
			<h:form id="crform">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" update="leftForm:tree :rightForm:plist :rightForm:toolbar"
							oncomplete="PF('alarmManagerDialog').hide()"
							actionListener="#{protectionSignalAlarmConfigController.save()}" icon="ui-icon-disk" />
						<p:commandButton icon="ui-icon-cancel" onclick="PF('alarmManagerDialog').hide()" value="取消"
							style="margin-left:5px" />
					</f:facet>
				</p:toolbar>
				<p:panelGrid id="signalInfopg" columns="2" cellpadding="4" style="width:100%;text-align:center">
					<h:outputText value="生产厂家:" />
					<p:selectOneMenu style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.manufacturer}"
						effect="fold" editable="true">
						<f:selectItems value="#{protectionSignalAlarmConfigController.companys}" />
					</p:selectOneMenu>
					<h:outputText value="保护型号:" />
					<p:inputText style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.protectedmodel}">
					</p:inputText>
					<h:outputText value="告警名称:" />
					<p:inputText style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.alarmcname}">
					</p:inputText>
					<h:outputText value="主保护闭锁:" />
					<p:selectOneMenu style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.firstlock}">
						<f:selectItem itemLabel="否" itemValue="0" />
						<f:selectItem itemLabel="是" itemValue="1" />
					</p:selectOneMenu>
					<h:outputText value="后备保护闭锁:" />
					<p:selectOneMenu style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.secondlock}">
						<f:selectItem itemLabel="否" itemValue="0" />
						<f:selectItem itemLabel="是" itemValue="1" />
					</p:selectOneMenu>
					<h:outputText value="重合闸闭锁:" />
					<p:selectOneMenu style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.thirdlock}">
						<f:selectItem itemLabel="否" itemValue="0" />
						<f:selectItem itemLabel="是" itemValue="1" />
					</p:selectOneMenu>
					<h:outputText value="备注:" />
					<h:inputTextarea style="width:100%"
						value="#{protectionSignalAlarmConfigController.currentSelectSignal.remark}" />
				</p:panelGrid>
			</h:form>
		</p:dialog>
	</ui:define>
</ui:composition>
